const mongoose = require('mongoose')    //引入Mongoose
const Schema = mongoose.Schema          //声明Schema
let ObjectId = Schema.Types.ObjectId    //声明Object类型
const articleSchema = new Schema({
    categoryId:{
		type : mongoose.Schema.ObjectId,
		ref : 'Category'
    },
    title:{type:String},
    des:{type:String},
    content:{type:String},
    view:{type:Number},
    collect:{type:Number},
    like:{type:Number},
    comment:{type:Number},
    releaseTime:{ type: Date, default: Date.now },
    authorId:{unique:true,type:Number},
    banner:[String]
})

mongoose.model('Article',articleSchema)